<template>
  <el-dialog
    class="container-edit"
    :title="title"
    :visible.sync="dialogFormVisible"
    @close="close"
  >
    <el-card class="box-card card1">
      <h2>订单详情</h2>
      <div>订单号:1321313131321</div>
      <div>车牌号:</div>
      <div>区域:</div>
      <div>手机号码:</div>
      <div>订单状态:</div>
      <div>创建时间:</div>
      <div>结束时间:</div>
    </el-card>
    <el-card class="box-card card2">
      <h2>结算信息</h2>
      <div>结算方式:</div>
      <div>骑行时长:</div>
      <div>骑行里程:</div>
      <div>骑行优惠:</div>
      <div>订单金额:</div>
      <div>实际支付:</div>
    </el-card>
    <el-card class="box-card card3">
      <h2>操作车辆记录</h2>
      <el-table style="width: 100%">
        <el-table-column label="时间" prop="date" width="220" />
        <el-table-column label="操作" prop="make" width="140" />
      </el-table>
    </el-card>
    <el-card class="box-card card4">
      <h2>车辆控制</h2>
      <el-button class="btn" type="primary">超出运营区域回电</el-button>
      <el-button class="btn" type="warning">车辆开锁</el-button>
      <el-button class="btn" type="danger">电量过低订单回溯</el-button>
      <!-- <div>超出运营区域回电</div>
      <div>车辆开锁</div>
      <div>电量过低订单回溯</div> -->
    </el-card>
    <el-card class="box-card card5">
      <h2>订单消费记录</h2>
      <el-table style="width: 100%">
        <el-table-column label="时间" prop="date" width="160" />
        <el-table-column label="操作" prop="make" width="140" />
        <el-table-column label="状态" prop="status" width="80" />
      </el-table>
    </el-card>
    <el-card class="box-card card6">
      <h2>手机信息</h2>
      <el-table height="300">
        <el-table-column label="类型" prop="shape" width="220" />
        <el-table-column label="数据值" prop="number" width="140" />
      </el-table>
    </el-card>
    <el-card class="box-card card7">
      <h2>位置信息</h2>
    </el-card>
    <el-card class="box-card card8">
      <h2>区域匹配信息</h2>
      <div>骑行费用:</div>
      <div>调度费用:</div>
    </el-card>

    <!-- <el-form ref="form" label-width="120px" :model="form" :rules="rules">
      <el-form-item label="商户">
        <el-select v-model="value1" placeholder="商户">
          <el-option
            v-for="item in options1"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="是否有调度费">
        <el-select v-model="value1" placeholder="是否有调度费">
          <el-option
            v-for="item in options1"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="是否返还调度费">
        <el-select v-model="value1" placeholder="是否返还调度费">
          <el-option
            v-for="item in options1"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="手机号" prop="title">
        <el-input v-model.trim="form.title" />
      </el-form-item>
      <el-form-item label="备注" prop="author">
        <el-input v-model.trim="form.author" />
      </el-form-item>
    </el-form> -->
    <!-- <template #footer>
      <el-button @click="close">取 消</el-button>
      <el-button type="primary" @click="save">确 定</el-button>
    </template> -->
  </el-dialog>
</template>

<script>
  import { doEdit } from '@/api/table'

  export default {
    name: 'TableEdit',
    data() {
      return {
        options1: [
          { value: '选项1', label: '黄金糕' },
          { value: '选项2', label: '双皮奶' },
          { value: '选项3', label: '蚵仔煎' },
          { value: '选项4', label: '龙须面' },
          { value: '选项5', label: '北京烤鸭' },
        ],
        value1: '',
        form: {
          title: '',
          author: '',
        },
        rules: {
          title: [{ required: true, trigger: 'blur', message: '请输入标题' }],
          author: [{ required: true, trigger: 'blur', message: '请输入作者' }],
        },
        title: '',
        dialogFormVisible: false,
      }
    },
    created() {},
    methods: {
      showEdit(row) {
        if (!row) {
          this.title = '添加'
        } else {
          this.title = '编辑'
          this.form = Object.assign({}, row)
        }
        this.dialogFormVisible = true
      },
      close() {
        this.$refs['form'].resetFields()
        this.form = this.$options.data().form
        this.dialogFormVisible = false
      },
      save() {
        this.$refs['form'].validate(async (valid) => {
          if (valid) {
            const { msg } = await doEdit(this.form)
            this.$baseMessage(msg, 'success', false, 'vab-hey-message-success')
            this.$emit('fetch-data')
            this.close()
          }
        })
      },
    },
  }
</script>
<style>
  /* .container-edit {
    width: 80%;
  } */
  .el-dialog__body {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
  }
  .text {
    font-size: 14px;
  }

  .item {
    margin-bottom: 18px;
  }

  .clearfix:before,
  .clearfix:after {
    display: table;
    content: '';
  }
  .clearfix:after {
    clear: both;
  }
  .el-dialog {
    width: 70%;
  }
  .box-card {
    /* display: flex;
    justify-content: center; */
    background-color: #eee;
  }
  .card1 {
    width: 20%;
    /* position: relative; */
  }
  /* .card1 h2 {
    position: absolute;
    left: 5px;
    top: 0;
  } */
  .card2 {
    width: 20%;
  }
  .card3 {
    width: 30%;
  }
  .card4 {
    width: 20%;
  }
  .card4 .btn {
    margin-top: 10px;
  }
  .card5 {
    width: 31%;
  }
  .card6 {
    width: 31%;
  }
  .card7 {
    width: 31%;
  }
  .card8 {
    width: 98%;
  }
</style>
